import React, { useEffect, useState, useRef } from 'react';
import { Space, PopUp } from '@/components/UiComponents'
import { CopyToClipboard, toast } from '@/utils/utils'
import { View, Button } from '@tarojs/components'
import './index.scss'
const Recommendation = (props) => {
  const { visible = {}, onClose, hpFlag = '0' } = props
  const { show = false, detail = {} } = visible
  const { } = detail
  useEffect(() => {
  }, [show])
  if (show) {
    return <PopUp
      zIndex={1000000000001}
      position={hpFlag === '0' ? 'bottom' : 'right'}
      onClose={() => onClose()}
      visible={show}>
      <View onClick={(e) => {
        e.stopPropagation()
      }} className={hpFlag === '1' ? 'recommendation_box recommendation_hp_box' : 'recommendation_box'}>
        <View className='recommendation_title_box'>推荐语</View>
        <View className='recommendation_title_desc'>分享到好友，附上推荐语更有诚意。</View>
        <View className='recommendation_title_content'>看，这个课程绝对棒，不看你会后悔的，来跟我一起学习吧。</View>
        <View className='recommendation_title_reload'>换一条</View>
        <View className='recommendation_title_button' onClick={() => {
          CopyToClipboard('看，这个课程绝对棒，不看你会后悔的，来跟我一起学习吧。')
        }}>复制文案</View>

      </View>
    </PopUp>
  }
  else {
    return null
  }
}
export default Recommendation